How to get old or default value of an input field after it changed to new value